<template>
  <div id="cart">
    <NavBar class="cart-nav">
      <div slot="center">购物车({{ cartLength }})</div>
    </NavBar>
    <Scroll class="content" ref="scroll">
      <CartList></CartList>
    </Scroll>
    <CartBottomBar></CartBottomBar>
  </div>
</template>
<script>
import NavBar from "components/common/navbar/NavBar";
import Scroll from "components/common/scroll/Scroll";
import CartBottomBar from './childComps/CartBottomBar'

import CartList from "./childComps/CartList";

import { mapGetters } from "vuex";

export default {
  name: "Cart",
  components: {
    NavBar,
    CartList,
    Scroll,
    CartBottomBar
  },
  computed: {
    ...mapGetters(["cartLength", "cartList"]),
  },
    activated(){
    this.$refs.scroll.refresh()
  }
};
</script>
<style scoped>
#cart {
  height: 100vh;
}
.content {
  height: calc(100% - 44px - 49px - 40px);
  overflow: hidden;
}
.cart-nav {
  background-color: var(--color-tint);
  color: #fff;
}
</style>